Skip to content

Introduce <RecordsIterator> - #10880

Merged
slax57 merged 63 commits into
nextfrom
remox-list-iterator
Sep 19, 2025
Merged

slax57 merged 63 commits into
nextfrom
remox-list-iterator

Conversation

@erwanMarmelab

@erwanMarmelab erwanMarmelab commented Aug 5, 2025 •

Copy link
Copy Markdown
Contributor

Problem

ListIterator has a drawback: empty, loading and error states appear inside the wrapper (often a <ul>). It makes it unusable in most cases.

Solution

  • Replace ListIterator by RecordsIterator, with an alias to ListIterator
  • Update <SimpleList>
  • Update WithListContext to accept optional empty, loading, error and offline components
  • Update ListBase / InfiniteListBase / EditBase / ShowBase and derivated components to accept optional authLoading, loading and error components.

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

@Madeorsk Madeorsk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does SimpleList still works when you pass data manually? It doesn't seem to be used and tested anymore.

Also, this is missing:

  • Update WithListContext to accept optional empty, loading and error components

Comment thread docs/ReferenceManyFieldBase.md Resolved
Comment thread docs/ReferenceFieldBase.md Resolved
Comment thread docs/ReferenceFieldBase.md Resolved
Comment thread docs/ReferenceArrayFieldBase.md Resolved
Comment thread docs/ReferenceFieldBase.md Resolved

@Madeorsk Madeorsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few issues related to WithListContext.

Comment thread docs/ReferenceArrayFieldBase.md Resolved
Comment thread docs/ReferenceFieldBase.md Resolved
Comment thread docs/ReferenceManyFieldBase.md Resolved
Comment thread docs/ReferenceManyFieldBase.md Resolved

@Madeorsk Madeorsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nearly done!

Comment thread docs/WithListContext.md Resolved
Comment thread docs/WithListContext.md Resolved
Comment thread docs/WithListContext.md Resolved
Comment thread docs/ReferenceArrayFieldBase.md Resolved
@fzaninotto fzaninotto changed the title Remove ListIterator [DNM] Remove ListIterator Aug 13, 2025

@slax57 slax57 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, incredible work! You apply changes very consistently, which makes the (otherwise painful) review process much easier, so kudos for that!

Comment thread docs/RecordsIterator.md Resolved
Comment thread docs/RecordsIterator.md
render={record => <li>{record.title} - {record.views}</li>}
/>
</ul>
</ListBase>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we now have an error prop on <ListBase>? 🤔

Comment thread docs/RecordsIterator.md Resolved
Comment thread docs/RecordsIterator.md Resolved
Comment thread docs/RecordsIterator.md Resolved
Comment thread docs/ReferenceFieldBase.md Resolved
Comment thread docs/List.md Resolved
Co-authored-by: Jean-Baptiste Kaiser <jb@marmelab.com>
Co-authored-by: Jean-Baptiste Kaiser <jb@marmelab.com>

@slax57 slax57 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!!! 🎉 🎉 🎉

This branch was successfully deployed

1 active deployment
Preview – react-admin-storybook — a1809e84 Deployed Sep 19, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants